home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
LOGIC Apps
/
Logic-APPLE_II_APPS.iso
/
mac
/
LOGIC Apple II 5.25" Library - ProDOS
/
PRO044.dsk
/
MAKE.DOS.bas
< prev
next >
Wrap
BASIC Source File
|
2012-02-16
|
6KB
|
112 lines
10 REM ===================
20 REM Make DOS
30 REM -------------------
40 REM
50 PRINT CHR$(4)"PR#3"
80 IF PEEK(12 *4096 +3 *256 +12) = 8 *16 +8 THEN GOSUB 1000
90 F$ = "RDLINE": ONERR GOTO 3000
100 PRINT CHR$(4)"BLOAD RDLINE,TCMD,A$4000": CALL 4 *4096
110 POKE 216,0
120 LOMEM: 6 *4096
130 GOSUB 1500
140 F$ = "DOS": ONERR GOTO 3000
150 PRINT CHR$(4)"BLOAD DOS,A$2400"
160 F$ = "DOS.MASTER": ONERR GOTO 3000
170 PRINT CHR$(4)"BLOAD DOS.MASTER"
180 POKE 216,0
190 SLOTS = 2 *4096 +4 *16 +6: IF PEEK(12 *4096 +3 *256 +12) = 8 *16 +8 THEN POKE 34, PEEK(37)
200 V0 = SLOTS +4:SIZE = V0 +16:VSIZ = SIZE +8:VT = VSIZE +8:ADRS = VT +8
210 DA = 11 *4096 +15 *256 +16:DC = DA +33:DL = DC +1
220 GOSUB 1000: GOSUB 850: PRINT "Support DOS 3.3 on what slot (type 0 <RTN> when done, ESC to abort): [";
230 PRINT CHR$(4)"RDLINE #]":S$
240 GOSUB 910: IF S$ = "0]" THEN 790
250 S = VAL(S$): IF S >7 THEN PRINT CHR$(8) CHR$(8);: GOTO 230
260 FOR I = 0 TO PEEK(DC): IF INT( PEEK(DL +I)/16) = S THEN 290
270 NEXT I
280 GOTO 520
290 IF NOT TIME THEN 320
300 FOR I = 0 TO TIME -1: IF S *16 = PEEK(SLOTS +I) THEN PRINT CHR$(8) CHR$(8);: GOTO 230
310 NEXT I
320 VH = PEEK(DA +2 *S +1):VL = PEEK(DA +2 *S)
330 IF VL = 0 AND VH = 13 *16 THEN 520
340 PRINT : PRINT : PRINT "DOS volume size wanted:": PRINT
350 PRINT " 560 sectors/volume = standard size of floppies."
360 PRINT " 800 sectors/volume = max size with 16 sectors/track"
370 PRINT "1600 sectors/volume = max size with 32 sectors/track"
380 PRINT : PRINT "Select 560, 800 or 1600: [";
390 DF$ = " 800": PRINT CHR$(4)"RDLINE %***]":NS$,DF$
400 GOSUB 910
410 NS = VAL(NS$): IF NS = 560 OR NS = 800 OR NS = 1600 THEN 430
420 PRINT CHR$(8) CHR$(8) CHR$(8) CHR$(8) CHR$(8);: GOTO 390
430 POKE 6,VL: POKE 7,VH: POKE 67,S *16: CALL 768
440 IF PEEK(7) >5 THEN 540
450 IF PEEK(7) THEN 520
460 PRINT : PRINT : PRINT "Device in slot ";S;" failed to report acceptable volume size. Please type the"
470 PRINT "total number of blocks on the device (ESC to abort): [";
480 PRINT CHR$(4)"RDLINE %****]":TB$
490 GET A$: IF A$ = CHR$(27) THEN 220
500 X = VAL(TB$): IF X <6 *256 THEN X = 256
510 POKE 7, INT(X/256): POKE 6,X -256 * INT(X/256): GOTO 440
520 PRINT : PRINT : PRINT "There is no supportable ProDOS volume in that slot. Press a key to continue."
530 GET A$: PRINT : GOTO 220
540 POKE SLOTS +TIME,S *16
550 X = INT(( PEEK(7) *256 + PEEK(6))/(NS/2)): IF X >255 THEN X = 255
560 PRINT : PRINT : PRINT "A maximum of ";X;" DOS volumes can be supported on each drive of this device."
570 PRINT : PRINT "How many DOS volumes on Slot ";S;" Drive 1: [";
580 F$ = "%%*]": IF X <100 THEN F$ = "%*]": IF X <10 THEN F$ = "*]"
590 PRINT CHR$(4)"RDLINE"F$:N$
600 GOSUB 910
610 N = VAL(N$): IF N >X THEN FOR I = 1 TO LEN(F$): PRINT CHR$(8);: NEXT I: GOTO 590
620 A0 = PEEK(6) +256 * PEEK(7) -(N +1) *NS/2: IF A0 <0 THEN A0 = A0 +4096 *16
630 AH = INT(A0/256):AL = A0 -AH *256: POKE V0 +TIME *4,AL: POKE V0 +TIME *4 +1,AH
640 PRINT : PRINT : PRINT "How many DOS volumes on Slot ";S;" Drive 2: [";
650 F$ = "%%*]": IF X <100 THEN F$ = "%*]": IF X <10 THEN F$ = "*]"
660 PRINT CHR$(4)"RDLINE"F$:N$
670 GOSUB 910
680 N = VAL(N$): IF N >X THEN FOR I = 1 TO LEN(F$): PRINT CHR$(8);: NEXT I: GOTO 660
690 PRINT : PRINT
700 A0 = PEEK(6) +256 * PEEK(7) -(N +1) *NS/2: IF A0 <0 THEN A0 = A0 +4096 *16
710 AH = INT(A0/256):AL = A0 -AH *256: POKE V0 +TIME *4 +2,AL: POKE V0 +TIME *4 +3,AH
720 POKE SIZE +TIME *2, PEEK(6): POKE SIZE +TIME *2 +1, PEEK(7)
730 AH = INT(NS/512):AL = NS -512 *AH: POKE VSIZE +TIME *2,AL/2: POKE VSIZE +TIME *2 +1,AH
740 POKE VT +TIME *2,17 *8: POKE VT +TIME *2 +1,0
750 IF NS = 1600 THEN POKE VT +TIME *2,17 *16 -256: POKE VT +TIME *2 +1,1
760 POKE ADRS +TIME *2,VL: POKE ADRS +TIME *2 +1,VH
770 TIME = TIME +1
780 IF TIME <4 THEN 220
790 IF NOT TIME THEN PRINT : PRINT : PRINT "No legal devices selected. Aborting.": GOTO 840
800 ONERR GOTO 820
810 PRINT : PRINT CHR$(4)"CREATE DOS.3.3,TSYS"
820 POKE 216,0: PRINT CHR$(4)"BSAVE DOS.3.3,TSYS,A$2000,L$2700"
830 PRINT : PRINT "All done. Use DOS.INSTALL to lay down DOS tracks on disks you wish supported."
840 TEXT : VTAB 21: PRINT : END
850 IF NOT TIME THEN RETURN
860 PRINT "Slots now supported: ";
870 FOR I = 0 TO TIME -1: PRINT PEEK(SLOTS +I)/16;
880 IF I <TIME -1 THEN PRINT ", ";
890 NEXT I
900 PRINT : PRINT : RETURN
910 GET K$: IF K$ = CHR$(27) THEN PRINT : PRINT : PRINT "Program aborted.": GOTO 840
920 RETURN
1000 PRINT CHR$(12);: IF PEEK(34) THEN RETURN
1010 PRINT TAB( 32)"Make DOS master"
1020 PRINT TAB( 32) CHR$(27) CHR$(15)"LLLLLLLLLLLLLLL" CHR$(24) CHR$(14)
1030 PRINT "This program allows you to set up to 4 slots to be supported by the DOS MASTER."
1040 PRINT "Each slot can have DOS volumes of size 560, 800 or 1600 sectors, and you can"
1050 PRINT "elect to have as many of these volumes (up to 255) as will fit on the existing"
1060 PRINT "ProDOS volume. Select these parameters with care. This program does not put"
1070 PRINT "DOS on any disks, it only creates the file DOS.3.3 from the DOS file which you"
1080 PRINT "converted from a DOS master disk as per the instructions. Use the DOS.INSTALL"
1090 PRINT "program to actually lay down the DOS volumes on your media. Note: you must"
1100 PRINT "type all parameters justified right in the field indicated."
1110 PRINT CHR$(27) CHR$(15);: FOR I = 1 TO 11: PRINT "SSSSSSS";: NEXT I: PRINT "SS"; CHR$(24) CHR$(14)
1120 RETURN
1500 FOR I = 0 TO 67: READ BYTE: POKE 768 +I,BYTE: NEXT I: RETURN
2000 DATA 169,0,120,133,68,133,70,133,71,133
2010 DATA 66,169,94,133,69,165,67,141,63,3
2020 DATA 44,139,192,44,139,192,32,59,3,44
2030 DATA 130,192,88,152,240,2,144,16,32,0
2040 DATA 191,128,62,3,174,41,94,172,42,94
2050 DATA 144,2,160,0,132,7,134,6,96,108
2060 DATA 6,0,3,0,0,94,2,0
3000 PRINT : PRINT "Cannot find the file ";F$;". Aborting."